{extend name='user/public/layout' /}
{block name='content'}
<div class="overflow_h">
    <div class="screen">
        <div class="screen_box01 overflow_h">
            <ul>
                <li><a href="{:url('user.ask/index')}">提问列表</a></li>
                <li><a href="{:url('user.ask/myanswer')}">回答列表</a></li>
                <li><a href="{:url('user.ask/help')}" class="on">求助列表</a></li>
                <li><a href="{:url('user.ask/add')}">我要提问</a></li>
            </ul>
        </div>
    </div>
    <div class="user-nav">
        <div class="Mtitle">
            <ul>
                <li class="on"><span><a href="{:url('user.ask/answer',['id'=>$info['id']])}">回答问题</a></span></li>
            </ul>
            <div class="rightWord"><a href="{:url('user.ask/help')}">向我求肋</a> &gt;&gt; 回答问题</div>
        </div>
        <form id="info_form" action="{:url('user.ask/answerDo')}" onsubmit="return check();" method="post" enctype="multipart/form-data">
            <input type="hidden" name="ask_id" value="{$info.id}">
            <div class="con_div">
                <ul class="formList width2 list_ul list_li">
                    <li><label>问题名称：</label>{$info.title}</li>
                    <li><label>问题描述：</label>{$info.content}</li>
                    <li><label>联系姓名：</label>{$info.user_name}</li>
                    <li><label>联系电话：</label>{$info.phone}</li>
                    <li><label>解决状态：</label><span class="blue">{if condition="$info['option'] eq 1"}已解决{else /}待解决{/if}</span></li>
                    {if condition='$info["option"] eq 0'}
                    <li class="height3">
                        <label>答案：</label>
                        <textarea class="textarea" id="answer" name="content"></textarea>
                    </li>
                    <li>
                        <label></label>
                        <input type="submit" value="提 交" class="btnStyle">
                    </li>
                    {/if}

                </ul>
            </div>
        </form>
        <table width="100%">
            <tr>
                <th width="70%">回答内容</th>
                <th width="20%">回答时间</th>
                <th width="10%">状态</th>
            </tr>
            {volist name='answer' id='vo'}
            <tr>
                <td>{$vo.content}</td>
                <td>{$vo.create_time|date='Y-m-d H:i:s',###}</td>
                <td align="center">{$vo.status == 1?'正常':'待审'}</td>
            </tr>
            {/volist}
        </table>
    </div>
</div>
<script>
    function check(){
        var answer = $('#answer').val();
        if(answer.length == 0){
            alert('请填写回答内容');
            return false;
        }
        return true;
    }
</script>
{/block}